package com.dts.yjnb.service.service.impl;

import com.dts.yjnb.service.domain.Region;
import com.dts.yjnb.service.domainDto.RegionDTO;
import com.dts.yjnb.service.mapper.RegionMapper;
import com.dts.yjnb.service.service.IRegionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 区域 服务层实现
 *
 * @author dts
 */
@Slf4j
@Service
public class RegionServiceImpl implements IRegionService
{
    @Autowired
    private RegionMapper regionMapper;


    @Override
    public List<Region> list(RegionDTO regionDTO) {
        //属性拷贝（包括beginTime和endTime）
        Region region = new Region();
        BeanUtils.copyProperties(regionDTO, region);

        // 查询所有符合条件的区域
        List<Region> list = regionMapper.list(region);
        return list;
    }
}

